--[[
 * 互换位置
 ]]
---@class BuffEffect28 : BaseBuffEffect
BuffEffect28 = ClientFight.CreateClass("BuffEffect28", ClientFight.BaseBuffEffect)
local t = BuffEffect28
---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local parameters = {...}
    local fighter = buff.source;
    local target = buff.target;
    local fighterNewPos = Vector2.New(target.position.x, target.position.y);
    local targetNewPos = Vector2.New(fighter.position.x, fighter.position.y);

    FighterManager.changePosition(fight, fighter, 0, fighterNewPos.x, fighterNewPos.y, 0, true, true, true);
    FighterManager.changePosition(fight, target, 0, targetNewPos.x, targetNewPos.y, 0, true, true, true);

    SkillRoleMgr.savePathFile(string.format("[%s][EFFECT]Fighter %s Buff %s 触发互换位置,施法者%s新位置%s,被施法者%s新位置%s",
            fight.frame, fighter.fighterId, buff.modelId, fighter.fighterId, getJsonStr(fighterNewPos), target.fighterId,getJsonStr( targetNewPos)));
    return ClientFight.BaseBuffEffect.action(self, fight, buff, parameters);
end

t.New()